Stored Procedures [dbo].[sp_asi_db_name]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@input_versionvarchar(20)20
Permissions
TypeActionOwning Principal
GrantExecuteIMIS
SQL Script
CREATE PROCEDURE sp_asi_db_name (@input_version varchar(20) = '4.0.0.0')
        AS
         declare @system_version varchar(20)
         select (convert (varchar(64), db_name ()))

         if @input_version <> '4.0.0.0'   -- iMIS passed in the version parameter (10.1 or higher client)
            begin
                select @system_version = ShortValue from System_Params
                    where ParameterName = 'System_Control.Version'
                   
                if @input_version >= @system_version
                    goto endit -- versions match (db and client) so proceed without upgrade
                end

         -- fell through to this point;
          -- either there's no input parameter, so iMIS didn't pass one in, and upgrade is needed;
          -- or there's a version mismatch between the db and the client, so an upgrade is needed
          exec sp_asi_ClientUpgrade

          endit:
          return

GO
GRANT EXECUTE ON  [dbo].[sp_asi_db_name] TO [IMIS]
GO
Uses